/*! @file parsethread.h
  * @brief Definition of ParseThread Class
  *
  * It parses file and displays it
  * @author AK
  * @date 10.10.2012
  */

#ifndef PARSETHREAD_H
#define PARSETHREAD_H

#include <QObject>
#include <QFile>
#include <QByteArray>
#include <QThread>
#include "binaryviewwidget.h"

class BinaryViewWidget;

/**
 * @brief Thread to parse file and display it in MainWindow
 *
 * @class ParseThread parsethread.h "PlacesParser/parsethread.h"
 */
class ParseThread : public QThread
{
    Q_OBJECT
public:
    ParseThread(QFile *f, BinaryViewWidget *bvw_pointer = 0);
    ~ParseThread();

    BinaryViewWidget* bvw_pointer;
    //QFile *file;

Q_SIGNALS:
    void error(QString err);
    void finished();
    void progressSetValue(int);
    void writeMe(QString finalbuffer);

public Q_SLOTS:
    int process();

private:
    bool empty;
    QFile* file;
    bool filterEmpty;
    int idx;                    // tab index
    QByteArray blob;
    int bytecount;
    int bytesperline;
    int columncount;
    long linecount;
    int emptylinecount;

};

#endif // PARSETHREAD_H
